﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Xmpp: ChatScenario.cs Source File</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                C# examples using state machines generated by StateBuilderDotNet
            </h1>
            <h3>
                Xmpp: ChatScenario.cs Source File
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">ChatScenario.cs</div>  </div>
</div>
<div class="contents">
<a href="_chat_scenario_8cs.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 ﻿
<a name="l00002"></a>00002 
<a name="l00003"></a><a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html">00003</a> <span class="keyword">namespace </span>StateForge.Examples.XmppChat
<a name="l00004"></a>00004 {
<a name="l00005"></a>00005     <span class="keyword">using</span> System;
<a name="l00006"></a>00006     <span class="keyword">using</span> System.Diagnostics;
<a name="l00007"></a>00007     <span class="keyword">using</span> agsXMPP;
<a name="l00008"></a>00008     <span class="keyword">using</span> agsXMPP.protocol.client;
<a name="l00009"></a>00009     <span class="keyword">using</span> StateForge.StateMachine;
<a name="l00010"></a>00010     <span class="keyword">using</span> agsXMPP.protocol.iq.roster;
<a name="l00011"></a>00011     <span class="keyword">using</span> agsXMPP.Xml.Dom;
<a name="l00012"></a>00012     <span class="keyword">using</span> System.Collections.Generic;
<a name="l00013"></a>00013 
<a name="l00014"></a>00014     <span class="keyword">public</span> delegate <span class="keywordtype">void</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#abc3c64a82bc0fe7fa1da12f9c46db315">EndEventHandler</a>(<span class="keywordtype">object</span> sender, EventArgs e);
<a name="l00015"></a>00015 
<a name="l00016"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html">00016</a>     <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html">ChatScenario</a>
<a name="l00017"></a>00017     {
<a name="l00018"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a5596eb496ea91e8d5c9be8eeb0f375e9">00018</a>         <span class="keyword">public</span> <span class="keyword">event</span> EndEventHandler <a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a5596eb496ea91e8d5c9be8eeb0f375e9">EndHandler</a>;
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a49b4397be12bf24d92e8f00a6007dfd0">00020</a>         <span class="keyword">public</span> <a class="code" href="interface_state_forge_1_1_examples_1_1_xmpp_chat_1_1_i_chat_scenario.html">IChatScenario</a> Context { <span class="keyword">get</span>; <span class="keyword">set</span>; }
<a name="l00021"></a>00021 
<a name="l00022"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#afaa5e47ba8257126e10972ed4efc0774">00022</a>         <span class="keyword">private</span> <span class="keywordtype">string</span> <a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#afaa5e47ba8257126e10972ed4efc0774">error</a>;
<a name="l00023"></a>00023         <span class="keyword">public</span> <span class="keywordtype">string</span> Error
<a name="l00024"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a3217b1b92c641f2f2d5af74690a6cafb">00024</a>         {
<a name="l00025"></a>00025             <span class="keyword">get</span>
<a name="l00026"></a>00026             {
<a name="l00027"></a>00027                 <span class="keywordflow">return</span> this.error;
<a name="l00028"></a>00028             }
<a name="l00029"></a>00029             <span class="keyword">set</span>
<a name="l00030"></a>00030             {
<a name="l00031"></a>00031                 ts.TraceEvent(TraceEventType.Error, 1, <span class="stringliteral">&quot;Error: {0}&quot;</span>, value);
<a name="l00032"></a>00032                 this.error = value;
<a name="l00033"></a>00033             }
<a name="l00034"></a>00034         }
<a name="l00035"></a>00035 
<a name="l00036"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a708e53fc73eb11fce440cd35c7c50b09">00036</a>         <span class="keyword">public</span> <span class="keywordtype">bool</span> HasError()
<a name="l00037"></a>00037         {
<a name="l00038"></a>00038             <span class="keywordflow">return</span> <span class="keywordtype">string</span>.IsNullOrEmpty(this.error) == <span class="keyword">false</span>;
<a name="l00039"></a>00039         }
<a name="l00040"></a>00040 
<a name="l00041"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#af354cef9f1302def7052b83cd73be0f3">00041</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> MaxDuration { <span class="keyword">get</span>; <span class="keyword">set</span>; }
<a name="l00042"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a120f7c5e51a9178ea2462e7f674c2e37">00042</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> IdleDuration { <span class="keyword">get</span>; <span class="keyword">set</span>; }
<a name="l00043"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a1c123dc8a19d4c8bf1a5b4ab1563e82d">00043</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> SubscribeMaxDuration { <span class="keyword">get</span>; <span class="keyword">set</span>; }
<a name="l00044"></a>00044 
<a name="l00045"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a9700afaaf600a5bf1327d009703d686d">00045</a>         <span class="keyword">private</span> <span class="keyword">static</span> readonly <span class="keywordtype">string</span> traceName = <span class="stringliteral">&quot;ChatScenario&quot;</span>;
<a name="l00046"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#aa59f33c73ae410e64c5ab95bea85a847">00046</a>         <span class="keyword">private</span> <span class="keyword">static</span> TraceSource ts = <span class="keyword">new</span> TraceSource(traceName);
<a name="l00047"></a>00047 
<a name="l00048"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a661d4dfe6a5b3bc30dbc538f79799a38">00048</a>         Dictionary&lt;string, Client&gt; clientMap = <span class="keyword">new</span> Dictionary&lt;string, Client&gt;();
<a name="l00049"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a7b699d45fed7b56cbf67cef7f0365e75">00049</a>         <span class="keyword">private</span> <span class="keywordtype">int</span> <a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a7b699d45fed7b56cbf67cef7f0365e75">numberOfClients</a>;
<a name="l00050"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a9d0287bf7b5a4b026a0612340b3f0d17">00050</a>         <span class="keyword">private</span> <span class="keywordtype">int</span> <a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a9d0287bf7b5a4b026a0612340b3f0d17">numberOfClientsOpended</a>;
<a name="l00051"></a>00051 
<a name="l00052"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#ab088f8bfb0cae4adbc5a4ae4116f30c1">00052</a>         <span class="keyword">public</span> <a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html">ChatScenario</a>()
<a name="l00053"></a>00053         {
<a name="l00054"></a>00054             MaxDuration = 30000;<span class="comment">/* 30 sec */</span>
<a name="l00055"></a>00055             IdleDuration = 100;
<a name="l00056"></a>00056             SubscribeMaxDuration = 5000;
<a name="l00057"></a>00057         }
<a name="l00058"></a>00058 
<a name="l00059"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#ab22b8f708be0df813446144404b6cb3a">00059</a>         <span class="keyword">public</span> <a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html">Client</a> CreateClient(<span class="keywordtype">string</span> user, <span class="keywordtype">string</span> password, <span class="keywordtype">string</span> server)
<a name="l00060"></a>00060         {
<a name="l00061"></a>00061             <a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html">Client</a> client = <span class="keyword">new</span> <a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html">Client</a>(user, password, server);
<a name="l00062"></a>00062             InitializeClient(client);
<a name="l00063"></a>00063             numberOfClients++;
<a name="l00064"></a>00064             this.clientMap.Add(client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a61556dffca0a90756e11390c9acc43e1">Jid</a>.ToString(), client);
<a name="l00065"></a>00065             <span class="keywordflow">return</span> client;
<a name="l00066"></a>00066         }
<a name="l00067"></a>00067 
<a name="l00068"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a631881dc0de2af36aebb555d538b28b5">00068</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> InitializeClient(<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html">Client</a> client)
<a name="l00069"></a>00069         {
<a name="l00070"></a>00070             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a7b54bbaf812db415ae05aae301033527">LoginHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#aa3dec4381dcdb6359c8e40192991dd8f">LoginEventHandler</a>(OnLogin);
<a name="l00071"></a>00071             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#ad17e946c7e43b3b9e2c098ca210e9b6b">CloseHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#aa3760b3c8128a3bdd38d725c41246fac">CloseEventHandler</a>(OnClose);
<a name="l00072"></a>00072             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a66a7d36a34de9d485d0b2a682c8ca09c">RosterEndHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#a5e6cb8f84daedc7940130d2a60ac0375">RosterEndEventHandler</a>(OnRosterEnd);
<a name="l00073"></a>00073             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a723ad06ab991e93bece21da91dddb545">AuthErrorHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#ac4f2fd7eb91b00d045d36c50224544fc">AuthErrorEventHandler</a>(OnAuthError);
<a name="l00074"></a>00074             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#abc155349dd63d0673f7393b6d9690f96">MessageHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#a4f58397d7c25dcadc53b4083951d83a5">MessageEventHandler</a>(OnMessage);
<a name="l00075"></a>00075             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a1751f8d91095aea87aa26c2362ded63e">PresenceHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#a093daaba61bc0d1fd8709003b3a93e7b">PresenceEventHandler</a>(OnPresence);
<a name="l00076"></a>00076             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#acb9192e15b46c450db9c0e366a6d0e53">SubscribeRequestHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#a9eec11bcd5c2ac93cd9085660aca187a">SubscribeRequestEventHandler</a>(OnSubscribeRequest);
<a name="l00077"></a>00077             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a16bee587a46664d8623ec32aed45f1a1">SubscribeConfirmHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#a9d5fa7af49c168e253aa9144e7e6f4af">SubscribeConfirmEventHandler</a>(OnSubscribeConfirm);
<a name="l00078"></a>00078             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a2b1a508421321afe94a555c5eeb101fa">ErrorHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#ada466e1de91ea6f948e6443a7ce668c1">ErrorEventHandler</a>(OnError);
<a name="l00079"></a>00079             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a8d1f5a8befa5cb71386d56a16181acf3">RosterItemHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#a834d9de6300f3b2080368250e708af96">RosterItemEventHandler</a>(OnRosterItem);
<a name="l00080"></a>00080             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#a66a7d36a34de9d485d0b2a682c8ca09c">RosterEndHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#a5e6cb8f84daedc7940130d2a60ac0375">RosterEndEventHandler</a>(OnRosterEnd);
<a name="l00081"></a>00081             client.<a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_client.html#aa9b98a10489ececbc299fb9902a8c094">IqErrorHandler</a> += <span class="keyword">new</span> <a class="code" href="namespace_state_forge_1_1_examples_1_1_xmpp_chat.html#aa1f3d1f316bc24f5b5af00fd94db5171">IqErrorEventHandler</a>(OnIqError);
<a name="l00082"></a>00082         }
<a name="l00083"></a>00083 
<a name="l00084"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#ab8e3e7b6540b2ead0965c784ff8e3550">00084</a>         <span class="keyword">public</span> <span class="keywordtype">void</span> OpenAll()
<a name="l00085"></a>00085         {
<a name="l00086"></a>00086             <span class="keywordflow">foreach</span> (KeyValuePair&lt;string, Client&gt; kvp <span class="keywordflow">in</span> this.clientMap)
<a name="l00087"></a>00087             {
<a name="l00088"></a>00088                 kvp.Value.Open();
<a name="l00089"></a>00089             }
<a name="l00090"></a>00090         }
<a name="l00091"></a>00091 
<a name="l00092"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#ae0a12619ca2cf65f077af3ffe1b515d5">00092</a>         <span class="keyword">public</span> <span class="keywordtype">void</span> CloseAll()
<a name="l00093"></a>00093         {
<a name="l00094"></a>00094             <span class="keywordflow">foreach</span> (KeyValuePair&lt;string, Client&gt; kvp <span class="keywordflow">in</span> this.clientMap)
<a name="l00095"></a>00095             {
<a name="l00096"></a>00096                 kvp.Value.Close();
<a name="l00097"></a>00097             }
<a name="l00098"></a>00098         }
<a name="l00099"></a>00099 
<a name="l00100"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a6701228fc318d35aa4389402b3bf38d5">00100</a>         <span class="keyword">public</span> <span class="keywordtype">void</span> Start()
<a name="l00101"></a>00101         {
<a name="l00102"></a>00102             this.Context.Start();
<a name="l00103"></a>00103         }
<a name="l00104"></a>00104 
<a name="l00105"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a161090059d50867b5b6640bfc1d5bcd8">00105</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnLogin(Object o, Jid jid)
<a name="l00106"></a>00106         {
<a name="l00107"></a>00107             this.Context.LoggedIn(jid);
<a name="l00108"></a>00108             numberOfClientsOpended++;
<a name="l00109"></a>00109             <span class="keywordflow">if</span> (numberOfClientsOpended == numberOfClients)
<a name="l00110"></a>00110             {
<a name="l00111"></a>00111                 this.Context.LoggedInAll();
<a name="l00112"></a>00112             }
<a name="l00113"></a>00113         }
<a name="l00114"></a>00114 
<a name="l00115"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a00e5e5dbf09760adb2331da6f133b59a">00115</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnClose(Object o, Jid jid)
<a name="l00116"></a>00116         {
<a name="l00117"></a>00117             this.Context.Closed(jid);
<a name="l00118"></a>00118             numberOfClientsOpended--;
<a name="l00119"></a>00119             <span class="keywordflow">if</span> (numberOfClientsOpended == 0)
<a name="l00120"></a>00120             {
<a name="l00121"></a>00121                 this.Context.ClosedAll();
<a name="l00122"></a>00122             }
<a name="l00123"></a>00123         }
<a name="l00124"></a>00124 
<a name="l00125"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a3e8fda03268f13ba932894ad67996373">00125</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnIqError(Object o, Jid jid, Error error)
<a name="l00126"></a>00126         {
<a name="l00127"></a>00127             this.Context.IqError(jid, error);
<a name="l00128"></a>00128         }
<a name="l00129"></a>00129 
<a name="l00130"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a2c98de7351b137af6f8449d562671d62">00130</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnAuthError(Object o, Jid jid, Element element)
<a name="l00131"></a>00131         {
<a name="l00132"></a>00132             this.Context.AuthError(jid, element);
<a name="l00133"></a>00133         }
<a name="l00134"></a>00134 
<a name="l00135"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a24d501a87d6615f35f6c1180cd2eae4b">00135</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnMessage(Object o, Jid jid, Message message)
<a name="l00136"></a>00136         {
<a name="l00137"></a>00137             this.Context.MessageRx(jid, message);
<a name="l00138"></a>00138         }
<a name="l00139"></a>00139 
<a name="l00140"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a98963e529c13e96998e4054924806123">00140</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnPresence(Object o, Jid jid, Presence presence)
<a name="l00141"></a>00141         {
<a name="l00142"></a>00142             this.Context.PresenceRx(jid, presence);
<a name="l00143"></a>00143         }
<a name="l00144"></a>00144 
<a name="l00145"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#ab48f72d94cdcacdb4115864ccf0dd6b3">00145</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnSubscribeRequest(Object o, Jid jid, Jid from)
<a name="l00146"></a>00146         {
<a name="l00147"></a>00147             this.Context.SubscribeRequest(jid, from);
<a name="l00148"></a>00148         }
<a name="l00149"></a>00149 
<a name="l00150"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a4d24d5065f4c862f6fbb9a889a210d1d">00150</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnSubscribeConfirm(Object o, Jid jid, Jid from)
<a name="l00151"></a>00151         {
<a name="l00152"></a>00152             this.Context.SubscribeConfirm(jid, from);
<a name="l00153"></a>00153         }
<a name="l00154"></a>00154 
<a name="l00155"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#ae61c8ed85d036ce341a4c77b4863a2ed">00155</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnError(Object o, Jid jid, System.Exception exception)
<a name="l00156"></a>00156         {
<a name="l00157"></a>00157             this.Context.Error(jid, exception);
<a name="l00158"></a>00158         }
<a name="l00159"></a>00159 
<a name="l00160"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a3db25278e5782fbc9b2c8c7cd95d701f">00160</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnRosterItem(Object o, Jid jid, RosterItem item)
<a name="l00161"></a>00161         {
<a name="l00162"></a>00162             this.Context.RosterItem(jid, item);
<a name="l00163"></a>00163         }
<a name="l00164"></a>00164 
<a name="l00165"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#aa8b36dcddbd9fa204b1ab18d749527f7">00165</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> OnRosterEnd(Object o, Jid jid)
<a name="l00166"></a>00166         {
<a name="l00167"></a>00167             this.Context.RosterEnd(jid);
<a name="l00168"></a>00168         }
<a name="l00169"></a>00169 
<a name="l00170"></a><a class="code" href="class_state_forge_1_1_examples_1_1_xmpp_chat_1_1_chat_scenario.html#a39258ad752ff798834ac19e382394742">00170</a>         <span class="keyword">private</span> <span class="keywordtype">void</span> StateMachineEnd(<span class="keywordtype">object</span> sender, EventArgs e)
<a name="l00171"></a>00171         {
<a name="l00172"></a>00172             <span class="keywordflow">if</span> (EndHandler != null)
<a name="l00173"></a>00173             {
<a name="l00174"></a>00174                 EndHandler(<span class="keyword">this</span>, EventArgs.Empty);
<a name="l00175"></a>00175             }
<a name="l00176"></a>00176         }
<a name="l00177"></a>00177     }
<a name="l00178"></a>00178 }
</pre></div></div>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
